<?php
require_once '../../prepend.php';
require_once 'MWorkflow.php';
require_once 'Workflow/MState.php';

$mw = new MWorkflow();

echo '<h1>initial state is - ' . $mw->initial_state . '</h1>';

$source = '/var/www/moreia/XML/mworkflow_v2.xml';

if($mw->load($source))
	echo '<h1>New initial state now is - ' . $mw->initial_state . '</h1>';

/*$mw->addState(new MState('published','object is published.'));
$mw->addState(new MState('hidden','object is not available.'));
$mw->addState(new MState('rejected', 'Object is rejected now.'));*/

echo "<h3>There are ".$mw->stateColl->size()." states inside the collection</h3>";
//var_dump($mw->stateColl);


foreach ($mw->stateColl as $k)
	echo $k->id. " : ".$k->title."<br>";

echo "<hr>";
	
/*if($mw->removeState('hidden')) 
	echo "state HIDDEN was removed!<br>";
else
	echo "state hidden not removed<br>";
	
echo "<br>";
foreach ($mw->stateColl as $k)
	echo $k->id. " - <br>";*/
?>